Skip to content

Adapt FormatFunc return type to the expected logrus.Fields type #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

d1egoaz
Copy link
Contributor

@d1egoaz d1egoaz commented Nov 24, 2022

Modifies listToLogrusFields to use FormatFunc, and adapt the later return type to the expected logrus.Fields type

Logrus:

// Fields type, used to pass to `WithFields`.
type Fields map[string]interface{}

https://github.com/sirupsen/logrus/blob/f8bf7650dccb756cea26edaf9217aab85500fe07/logrus.go#LL10

Modifies `listToLogrusFields` to use `FormatFunc`, and adapt the later to the expected logrus.Fields type

Logrus:
```go
// Fields type, used to pass to `WithFields`.
type Fields map[string]interface{}
```
https://github.com/sirupsen/logrus/blob/f8bf7650dccb756cea26edaf9217aab85500fe07/logrus.go#LL10
@d1egoaz d1egoaz changed the title Adapt FormatFunc return type to the expected logrus.Fields type Adapt FormatFunc return type to the expected logrus.Fields type Nov 24, 2022
@bombsimon
Copy link
Owner

Thanks for this! Makes sense to use the same as logrus.

@bombsimon bombsimon merged commit 3576cd1 into bombsimon:main Nov 25, 2022
@bombsimon
Copy link
Owner

Released in v4.0.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants